package entities;
// default package
// Generated 2014-07-29 18:57:10 by Hibernate Tools 3.4.0.CR1

import java.math.BigDecimal;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

@Entity
@Table(name="T_INVOICE_DETAILS")
public class InvoiceDetails implements java.io.Serializable {

	private static final long serialVersionUID = 1L;
	private int invoiceDetailsId;
	private Product product;
	private int amount;
	private Invoice invoice;
	private BigDecimal netValue;
	private BigDecimal vat;
	private BigDecimal grossValue;

	public InvoiceDetails() {
	}

	public InvoiceDetails(Product product, int amount, Invoice invoice, BigDecimal netValue,
			BigDecimal vat, BigDecimal grossValue) {
		this.product = product;
		this.amount = amount;
		this.invoice = invoice;
		this.netValue = netValue;
		this.vat = vat;
		this.grossValue = grossValue;
	}

	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	@Column(name="INVOICE_DETAILS_ID",unique = true, nullable = false)
	public int getInvoiceDetailsId() {
		return invoiceDetailsId;
	}

	public void setInvoiceDetailsId(int invoiceDetailsId) {
		this.invoiceDetailsId = invoiceDetailsId;
	}

	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "PRODUCT_ID", nullable = false)
	public Product getProduct() {
		return product;
	}

	public void setProduct(Product product) {
		this.product = product;
	}

	@Column(name="AMOUNT", nullable=false)
	public int getAmount() {
		return amount;
	}

	public void setAmount(int amount) {
		this.amount = amount;
	}

	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "INVOICE_ID", nullable = false)
	public Invoice getInvoice() {
		return invoice;
	}

	public void setInvoice(Invoice invoice) {
		this.invoice = invoice;
	}

	@Column(name="NET_VALUE", nullable=false)
	public BigDecimal getNetValue() {
		return netValue;
	}

	public void setNetValue(BigDecimal netValue) {
		this.netValue = netValue;
	}

	@Column(name="VAT", nullable=false)
	public BigDecimal getVat() {
		return vat;
	}

	public void setVat(BigDecimal vat) {
		this.vat = vat;
	}

	@Column(name="GROSS_VALUE", nullable=false)
	public BigDecimal getGrossValue() {
		return grossValue;
	}

	public void setGrossValue(BigDecimal grossValue) {
		this.grossValue = grossValue;
	}

	
	
}
